/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.bingoogolapple.badgeview.demo.model;

import java.util.ArrayList;
import java.util.List;

/**
 * MessageModel 模型类
 *
 * @since 2021-04-21
 */
public class MessageModel {
    private static final int MESSAGEMODELNUM = 10;
    private static final int RANDOMNUM = 150;

    /**
     * 标题
     */
    private String mTitle;

    /**
     * 内容
     */
    private String mDetail;

    /**
     * 消息数量
     */
    private int mNewMsgCount;

    /**
     * 构造器
     *
     * @param title
     * @param detail
     * @param newMsgCount
     */
    public MessageModel(String title, String detail, int newMsgCount) {
        this.mTitle = title;
        this.mDetail = detail;
        this.mNewMsgCount = newMsgCount;
    }

    /**
     * getTitle
     *
     * @return String
     */
    public String getTitle() {
        return mTitle;
    }

    /**
     * setTitle
     *
     * @param title
     */
    public void setTitle(String title) {
        this.mTitle = title;
    }

    /**
     * getDetail
     *
     * @return String
     */
    public String getDetail() {
        return mDetail;
    }

    /**
     * setDetail
     *
     * @param detail
     */
    public void setDetail(String detail) {
        this.mDetail = detail;
    }

    /**
     * getNewMsgCount
     *
     * @return int
     */
    public int getNewMsgCount() {
        return mNewMsgCount;
    }

    /**
     * setNewMsgCount
     *
     * @param newMsgCount
     */
    public void setNewMsgCount(int newMsgCount) {
        this.mNewMsgCount = newMsgCount;
    }

    /**
     * 构造模型数据
     *
     * @return 数据集合
     */
    public static List<MessageModel> getTestData() {
        List<MessageModel> messages = new ArrayList<>();
        for (int index = 0; index < MESSAGEMODELNUM; index++) {
            int messageNum = index + 1;
            messages.add(new MessageModel("title" + index, "detail" + index, messageNum));
        }
        return messages;
    }
}
